﻿using System;

namespace DocumentMaking.FluentNext.Models;

[Serializable]
public class PythonFileInfoModel
{
    public string Name { get; set; } = "";
    public string FileName { get; set; } = "";
    public string Description { get; set; } = "";
    public string Image { get; set; } = "";

    public static PythonFileInfoModel[] GetDefault() =>
    [
        new()
        {
            Name = "Docx转成Pdf",
            FileName = "DocxToPdf",
            Description = "将Docx文件转换成Pdf文件",
            Image = "\uEA90"
        },
        new()
        {
            Name = "身份信息",
            FileName = "IdCardAddressShowFromExcel",
            Description = "将Excel表格里头的身份信息解析出来",
            Image = "\uEA8C"
        },
        new()
        {
            Name = "Pdf转成Docx",
            FileName = "PdfToDocx",
            Description = "将Pdf文件转换成Docx文件",
            Image = "F8081".Glyph()
        }
    ];
}

public static class StringGlyph
{
    public static string Glyph(this string codepoint)
        => char.ConvertFromUtf32((int)Convert.ToUInt32(codepoint, 16));
}